Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@commitlint/format
Advanced tools
@commitlint/format is a package used to format commit messages according to specified rules. It is part of the commitlint suite, which helps enforce consistent commit message conventions.
Format Commit Messages
This feature allows you to format the results of commit message linting. The `format` function takes an object with a `results` array and returns a formatted string that can be logged or displayed.
const { format } = require('@commitlint/format');
const results = [
{ valid: true, errors: [], warnings: [] },
{ valid: false, errors: [{ message: 'type may not be empty' }], warnings: [] }
];
const output = format({ results });
console.log(output);
Commitizen is a tool that helps you write consistent commit messages by providing an interactive prompt. Unlike @commitlint/format, which focuses on formatting and linting commit messages, Commitizen guides you through the process of writing them.
Conventional Changelog is a tool that generates changelogs based on commit messages that follow a specific convention. While @commitlint/format is used for formatting commit messages, Conventional Changelog focuses on generating changelogs from those messages.
Semantic Release automates the versioning and package publishing process based on commit messages. It uses commit message conventions to determine the type of release. Unlike @commitlint/format, which is used for formatting commit messages, Semantic Release automates the release process.
Format commitlint reports
npm install --save @commitlint/format
const format = require('@commitlint/format').default;
const output = format(
{
valid: false,
errorCount: 1,
warningCount: 1,
results: [
{
valid: false,
input: 'some: commit message',
errors: [
{
valid: false,
level: 2,
name: 'some-error',
message: 'This will show up red as it has level 2',
},
],
warnings: [
{
valid: true,
level: 0,
name: 'some-hint',
message: 'This will not show up as it has level 0',
},
{
valid: false,
level: 1,
name: 'some-warning',
message: 'This will show up yellow as it has level 1',
},
],
},
],
},
{
color: false,
}
);
process.stdout.write(output);
/* => [
'✖ This will show up red as it has level 2 [some-error]',
' This will not show up as it has level 0 [some-hint]',
'⚠ This will show up yellow as it has level 1 [some-warning]',
'✖ found 1 problems, 2 warnings'
] */
Consult docs/api for comprehensive documentation.
FAQs
Format commitlint reports
We found that @commitlint/format demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.